﻿using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Domain.Entities;

namespace AbpZero.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class TestController : AbpZeroController
    {
        [HttpGet("")]
        public ActionResult Test(int code)
        {
            switch (code)
            {
                case 1: throw new EntityNotFoundException("EntityNotFoundException");
                case 2: throw new UserFriendlyException("UserFriendlyException");
            }

            return Success(200, "success");
        }
    }
}